class Skill:
    def __init__(self, name, cool_time, duration_time, attack_distance):
        self.name = name
        self.cool_time = cool_time
        self.duration_time = duration_time
        self.attack_distance = attack_distance

    @property
    def name(self):
        return self.__name

    @name.setter
    def name(self, value):
        self.__name = value

    @property
    def cool_time(self):
        return self.__cool_time

    @cool_time.setter
    def cool_time(self, value):
        self.__cool_time = value

    @property
    def duration_time(self):
        return self.__duration_time

    @duration_time.setter
    def duration_time(self, value):
        self.__duration_time = value

    @property
    def attack_distance(self):
        return self.__attack_distance

    @attack_distance.setter
    def attack_distance(self, value):
        self.__attack_distance = value

    @staticmethod
    def search_name(list_objs, search_name):
        return [obj for obj in list_objs if obj.name == search_name]

    @staticmethod
    def search_duration_time(list_objs, second):
        return [obj for obj in list_objs if obj.duration_time > second]

    @staticmethod
    def find_max_attack_distance(list_objs):
        max_obj = list_objs[0]
        for obj in list_objs:
            if obj.attack_distance > max_obj.attack_distance:
                max_obj = obj
        return max_obj

    @staticmethod
    def sort(list_objs):
        for i in range(len(list_objs)):
            for j in range(i + 1, len(list_objs)):
                if list_objs[i].duration_time > list_objs[j].duration_time:
                    list_objs[i], list_objs[j] = list_objs[j], list_objs[i]
        return list_objs

    @staticmethod
    def print_objs(list_objs):
        for obj in list_objs:
            print(obj.__dict__)


s1 = Skill('疾跑', 200, 10, 300)
s2 = Skill('寒冰', 300, 30, 400)
s3 = Skill('电击', 100, 10, 300)

list_obj = [s1, s2, s3]
# Skill.print_objs(Skill.search_name(list_objs, '疾跑'))

# Skill.print_objs(Skill.search_duration_time(list_objs, 10))

# print(Skill.find_max_attack_distance(list_objs).__dict__)

Skill.print_objs(Skill.sort(list_obj))
